package com.qf.pojo;

/**
 * @author Kuke
 * @date 2022/3/11 15:00
 * 购物车项
 */
public class CartItem {

    //商品实体
    private Product product ;

    //商品数量
    private Integer count ;

    //小计金额
    private Double subTotal = 0.0 ;

    public CartItem() {
    }

    public CartItem(Product product, Integer count) {
        this.product = product;
        this.count = count;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    /**
     * 小计金额可以计算出来
     * @return
     */
    public Double getSubTotal() {
        return this.count * product.getShop_price();
    }

    public void setSubTotal(Double subTotal) {
        this.subTotal = subTotal;
    }
}
